package com.ican.oc.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="product")
public class OcProduct implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy=IDENTITY)
    @Column(name = "product_id", unique = true, nullable = false)
    private Integer productId;
    @Column(name = "model")
    private String model;
    @Column(name = "sku")
    private String sku;
    @Column(name = "upc")
    private String upc;
    @Column(name = "location")
    private String location;
    @Column(name = "quantity")
    private Integer quantity;
    @Column(name = "stock_status_id")
    private Integer stockStatusId;
    @Column(name = "image")
    private String image;
    @Column(name = "manufacturer_id")
    private Integer manufacturerId;
    @Column(name = "shipping")
    private byte shipping;
    @Column(name = "price")
    private Double price;
    @Column(name = "points")
    private Integer points;
    @Column(name = "tax_class_id")
    private Integer taxClassId;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_available", length = 19)
    private Date dateAvailable;
    @Column(name = "weight")
    private Double weight;
    @Column(name = "weight_class_id")
    private Integer weightClassId;
    @Column(name = "length")
    private Double length;
    @Column(name = "width")
    private Double width;
    @Column(name = "height")
    private Double height;
    @Column(name = "length_class_id")
    private Integer lengthClassId;
    @Column(name = "subtract")
    private byte subtract;
    @Column(name = "minimum")
    private Integer minimum;
    @Column(name = "sort_order")
    private Integer sortOrder;
    @Column(name = "status")
    private byte status;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_added", length = 19)
    private Date dateAdded;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "date_modified", length = 19)
    private Date dateModified;
    @Column(name = "viewed")
    private Integer viewed;
    
    public OcProduct(){
        
    }
    
    public OcProduct(String model, String image, Double price, Double weight, Integer weightClassId){
        Date dateTemp = new Date();
        if(model == null){
            this.model = "";
        }else{
            this.model = model;
        }
        this.sku = "";
        this.upc ="";
        this.location = "";
        this.quantity = 100;
        this.stockStatusId = 6;
        if(image == null){
            this.image = "";
        }else{
            this.image = image;
        }
        this.manufacturerId = 0;
        this.shipping = 1;
        if(price == null){
            this.price = 0D;
        }else{
            this.price = price;
        }
        this.points = 0;
        this.taxClassId = 0;
        this.dateAvailable = dateTemp;
        if(weight == null){
            this.weight = 0D;
        }else{
            this.weight = weight;
        }
        if(weightClassId == null){
            this.weightClassId = 1;
        }else{
            this.weightClassId = weightClassId;
        }
        this.length = 0D;
        this.width = 0D;
        this.height = 0D;
        this.lengthClassId = 1;
        this.subtract = 1;
        this.minimum = 1;
        this.sortOrder = 0;
        this.status = 0;
        this.dateAdded = dateTemp;
        this.dateModified = dateTemp;
        this.viewed = 0;
    }

    public Integer getProductId() {
        return productId;
    }
    public void setProductId(Integer productId) {
        this.productId = productId;
    }
    public String getModel() {
        return model;
    }
    public void setModel(String model) {
        this.model = model;
    }
    public String getSku() {
        return sku;
    }
    public void setSku(String sku) {
        this.sku = sku;
    }
    public String getUpc() {
        return upc;
    }
    public void setUpc(String upc) {
        this.upc = upc;
    }
    public String getLocation() {
        return location;
    }
    public void setLocation(String location) {
        this.location = location;
    }
    public Integer getQuantity() {
        return quantity;
    }
    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }
    public Integer getStockStatusId() {
        return stockStatusId;
    }
    public void setStockStatusId(Integer stockStatusId) {
        this.stockStatusId = stockStatusId;
    }
    public String getImage() {
        return image;
    }
    public void setImage(String image) {
        this.image = image;
    }
    public Integer getManufacturerId() {
        return manufacturerId;
    }
    public void setManufacturerId(Integer manufacturerId) {
        this.manufacturerId = manufacturerId;
    }
    public byte getShipping() {
        return shipping;
    }
    public void setShipping(byte shipping) {
        this.shipping = shipping;
    }
    public Double getPrice() {
        return price;
    }
    public void setPrice(Double price) {
        this.price = price;
    }
    public Integer getPoints() {
        return points;
    }
    public void setPoints(Integer points) {
        this.points = points;
    }
    public Integer getTaxClassId() {
        return taxClassId;
    }
    public void setTaxClassId(Integer taxClassId) {
        this.taxClassId = taxClassId;
    }
    public Date getDateAvailable() {
        return dateAvailable;
    }
    public void setDateAvailable(Date dateAvailable) {
        this.dateAvailable = dateAvailable;
    }
    public Double getWeight() {
        return weight;
    }
    public void setWeight(Double weight) {
        this.weight = weight;
    }
    public Integer getWeightClassId() {
        return weightClassId;
    }
    public void setWeightClassId(Integer weightClassId) {
        this.weightClassId = weightClassId;
    }
    public Double getLength() {
        return length;
    }
    public void setLength(Double length) {
        this.length = length;
    }
    public Double getWidth() {
        return width;
    }
    public void setWidth(Double width) {
        this.width = width;
    }
    public Double getHeight() {
        return height;
    }
    public void setHeight(Double height) {
        this.height = height;
    }
    public Integer getLengthClassId() {
        return lengthClassId;
    }
    public void setLengthClassId(Integer lengthClassId) {
        this.lengthClassId = lengthClassId;
    }
    public byte getSubtract() {
        return subtract;
    }
    public void setSubtract(byte subtract) {
        this.subtract = subtract;
    }
    public Integer getMinimum() {
        return minimum;
    }
    public void setMinimum(Integer minimum) {
        this.minimum = minimum;
    }
    public Integer getSortOrder() {
        return sortOrder;
    }
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    public byte getStatus() {
        return status;
    }
    public void setStatus(byte status) {
        this.status = status;
    }
    public Date getDateAdded() {
        return dateAdded;
    }
    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }
    public Date getDateModified() {
        return dateModified;
    }
    public void setDateModified(Date dateModified) {
        this.dateModified = dateModified;
    }
    public Integer getViewed() {
        return viewed;
    }
    public void setViewed(Integer viewed) {
        this.viewed = viewed;
    }
}
